<template>
  <div class="login-container">
    <div class="background-gradient"></div>
    <div class="login-box">
      <h1 class="login-title">体检预约-登录</h1>
      
      <form @submit.prevent="handleLogin" class="login-form">
        <div class="input-group">
          <div class="input-icon">👤</div>
          <input type="tel" v-model="loginData.phone" placeholder="输入手机号" required>
        </div>
        
        <div class="input-group">
          <div class="input-icon">🔒</div>
          <input :type="showPassword ? 'text' : 'password'" v-model="loginData.password" placeholder="输入登录密码" required>
          <button type="button" class="toggle-password" @click="showPassword = !showPassword">
            {{ showPassword ? '隐藏' : '显示' }}
          </button>
        </div>
        
        <div class="form-options">
          <span @click="$router.push('/registerview')">注册</span>
          <span>忘记密码?</span>
        </div>
        
        <button type="submit" class="login-btn">登录</button>
      </form>
      
      <div class="customer-service">
        有疑问请联系客服<br>
        4008-XXX-XXX
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Login',
  data() {
    return {
      loginData: {
        phone: '',
        password: ''
      },
      showPassword: false
    }
  },
  methods: {
    handleLogin() {
      // 模拟登录成功
      alert('登录成功！')
      this.$router.push('/indexview')
    }
  }
}
</script>

<style scoped>
.login-container {
  min-height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.background-gradient {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, #a8e6cf, #3d84a8);
  z-index: -1;
}

.login-box {
  background: white;
  border-radius: 12px;
  padding: 30px 25px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.login-title {
  text-align: center;
  margin-bottom: 30px;
  font-size: 20px;
  font-weight: 600;
  color: #333;
}

.input-group {
  position: relative;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #e0e0e0;
  padding: 10px 0;
}

.input-icon {
  margin-right: 10px;
  font-size: 18px;
}

.input-group input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 16px;
  padding: 8px 0;
  background: transparent;
}

.input-group input::placeholder {
  color: #999;
}

.toggle-password {
  background: none;
  border: none;
  color: #999;
  font-size: 14px;
  cursor: pointer;
}

.form-options {
  display: flex;
  justify-content: space-between;
  margin: 15px 0 25px;
  font-size: 14px;
  color: #1abc9c;
}

.form-options span {
  cursor: pointer;
}

.login-btn {
  width: 100%;
  background-color: #1abc9c;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 14px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.login-btn:active {
  background-color: #16a085;
}

.customer-service {
  text-align: center;
  margin-top: 25px;
  font-size: 14px;
  color: #666;
  line-height: 1.5;
}
</style>